package com.study.business.user.mapper;

import com.study.business.user.domain.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/********************************************
 * @author: zhang
 * @Description: com.green.user.mapper
 * @Date: 下午 11:35 2018/6/12 0012
 * @Modified By:
 ********************************************/
@Repository
public interface UserMapper {

    /**
     * 查询所有用户
     *
     * @return
     * @throws DataAccessException
     */
    List<User> getAll() throws DataAccessException;

    /**
     * 添加用户
     *
     * @param user
     * @return
     * @throws DataAccessException
     */
    boolean addUser(@Param("user") User user) throws DataAccessException;

    /**
     * 删除用户
     *
     * @param userID
     * @return
     * @throws DataAccessException
     */
    boolean deleteUser(@Param("id") String userID) throws DataAccessException;

    /**
     * 更新用户
     *
     * @param user
     * @return
     * @throws DataAccessException
     */
    boolean updateUser(@Param("user") User user) throws DataAccessException;

    /**
     * 查找用户
     *
     * @param userName
     * @return
     * @throws DataAccessException
     */
    User findUser(@Param("nickName") String userName) throws DataAccessException;


    /**
     * sdsa
     *
     * @param id
     * @return
     * @throws DataAccessException
     */
    Map<String, Object> getUser(@Param("id") String id) throws DataAccessException;

}
